import { defineEventHandler } from 'h3';

export default defineEventHandler(async () => {
  // 模拟状态历史数据
  const history = [
    {
      state: 'idle',
      timestamp: '2024-01-15T10:00:00Z',
      reason: '房间初始化',
    },
    {
      state: 'reserved',
      timestamp: '2024-01-15T14:30:00Z',
      reason: '客户预订',
    },
    {
      state: 'occupied',
      timestamp: '2024-01-16T15:00:00Z',
      reason: '客户入住',
    },
    {
      state: 'cleaning',
      timestamp: '2024-01-17T11:00:00Z',
      reason: '客户退房',
    },
    {
      state: 'idle',
      timestamp: '2024-01-17T13:30:00Z',
      reason: '清洁完成',
    },
  ];

  return {
    code: 0,
    data: history,
    message: '获取状态历史成功',
  };
});
